import java.util.*;
public class Main1
{
    public static void main(String[] args)
    {
        Scanner cin = new Scanner(System.in);

        int n = cin.nextInt();
        int arr[] = new int[n];

        arr[0] = cin.nextInt();
        int ma = arr[0];
        int maPos = 0,miPos = 0;
        for(int i =1;i<n;i++)
        {
            arr[i] = cin.nextInt();
            if(arr[i]>ma)
            {
                ma = arr[i];
                maPos = i;
            }
        }

        System.out.print(ma+" "+maPos);
        cin.close();
    }
}
